﻿@model Wabo.Dal.SystemSettings

@{
    ViewBag.Title = "Index";
}

@using (Html.BeginForm("Index", "SystemSettings", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <fieldset>
        <legend>Settings</legend>
        <div class="row">
            <!-- Global Settings -->
            <div class="span6">
                <div class="control-group">
                    @Html.LabelFor(s => s.application_name, new { @class = "control-label" })
                    <div class="controls">
                        @Html.TextBoxFor(s => s.application_name)
                    </div>
                </div>
                <div class="control-group">
                    @Html.LabelFor(s => s.log_items_per_page, new { @class = "control-label" })
                    <div class="controls">
                        @Html.TextBoxFor(s => s.log_items_per_page)
                    </div>
                </div>
                <div class="control-group">
                    @Html.LabelFor(s => s.login_lock_timeout,new { @class = "control-label" })
                    <div class="controls">
                        @Html.TextBoxFor(s => s.login_lock_timeout)
                    </div>
                </div>
                <div class="control-group">
                    @Html.LabelFor(s => s.max_login_attempts,new { @class = "control-label" })
                    <div class="controls">
                        @Html.TextBoxFor(s => s.max_login_attempts)
                    </div>

                </div>
                <div class="control-group">
                    @Html.LabelFor(s => s.days_to_purge,new { @class = "control-label" })
                    <div class="controls">
                        @Html.TextBoxFor(s => s.days_to_purge)
                    </div>
                </div>
        
                <div class="control-group">
                    @Html.LabelFor(s => s.theme,new { @class = "control-label" })
                    <div class="controls">
                        @Html.DropDownListFor(s => s.theme, (IEnumerable<SelectListItem>)ViewBag.Themes)
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox">
                            @Html.CheckBoxFor(s => s.enable_active_directory_login)
                            @Html.LabelFor(s => s.enable_active_directory_login)            
                        </label>
                    </div>
                </div>        
            </div>
            <!-- End Global Settings -->
            <!-- Smtp Server Settings -->
            <div class="span6">
                <h4>@Messages.SystemSettingsSMTPSettingsTitle</h4>
                <div class="control-group">
                    @Html.LabelFor( s => s.smtp_server, new{@class="control-label"} )
                    <div class="controls">
                        @Html.TextBoxFor( s => s.smtp_server )
                    </div>
                </div>
                <div class="control-group">
                    @Html.LabelFor( s => s.smtp_port,new{@class="control-label"})
                    <div class="controls">
                        @Html.TextBoxFor(s => s.smtp_port)
                    </div>
                </div>
                <div class="control-group">
                    @Html.LabelFor( s => s.smtp_user_name, new {@class="control-label"})
                    <div class="controls">
                        @Html.TextBoxFor(s => s.smtp_user_name)
                    </div>
                </div>
                <div class="control-group">
                    @Html.LabelFor( s => s.smtp_password, new {@class="control-label"})
                    <div class="controls">
                        @Html.TextBoxFor(s => s.smtp_password)
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox">                            
                            @Html.CheckBoxFor( s => s.smtp_enable_ssl )
                            @Html.LabelFor( s => s.smtp_enable_ssl )
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <!-- End Smtp Settings -->
        <div class="row">
            <div class="span4"></div>
            <div class="span4"></div>
            <div class="span4">
                <button type="submit" class="pull-right btn btn-primary">@Messages.ButtonUpdate</button>
            </div>
        </div>
    </fieldset>
}

